import { TownBuildType, TownEffects, TownEvent, TownEventType, TownTask } from "js/typeDefine/typeDefine";

export default {
    deepDropTowItemRate: 20,
    dropTonwItemID: 170008,
    reduceSaveScoreValues: [0, 10],
    reduceSaveScoreTimes: 43200000,
    maxLvl: 10,
    townMaxLvl: 25,
    list: [
        {
            name: '城镇建设',
            kind: TownBuildType.Town,
            maxLvl: 10,
            buildTime: [3600000, 3600000],
            npc: 'houseKeeper',
            boomingValues: [0, 2000, 0.5],
            effects: {
                [TownEffects.AddPerOfResources]: {
                    gold: { limitLvl: 1, values: [0, 5] },
                    exp: { limitLvl: 2, values: [0, 5] },
                }
            },
            lvlUpNeed: {
                preLvl: {
                    2: {
                        [TownBuildType.Task]: 1
                    },
                    4: {
                        [TownBuildType.Task]: 3
                    },
                    6: {
                        [TownBuildType.Task]: 5
                    },
                    8: {
                        [TownBuildType.Task]: 7
                    },
                    10: {
                        [TownBuildType.Task]: 9
                    }
                },
                items: [
                    { itemID: 'gold', amount: [10000, 10000, 30000] },
                    { itemID: 170001, amount: [1000, 1000, 1000] },
                    { itemID: 170005, amount: [5, 5, 5], limitLvl: [5, 100] },
                    { itemID: 170008, amount: [0, 5, 1] },
                ],
            }
        },
        {
            name: '卫兵',
            kind: TownBuildType.Task,
            unlockTownLvl: 1,
            unlockTownSaveScore: 80,
            maxLvl: 10,
            buildTime: [600000, 600000],
            npc: 'task',
            boomingValues: [0, 300, 0.5],
            effects: {
                [TownEffects.AddPerOfAttri]: {
                    maxHpPer: { limitLvl: 1, values: [0, 2] },
                    defPer: { limitLvl: 3, values: [0, 2.5] },
                }
            },
            lvlUpNeed: {
                preLvl: {
                    2: {
                        [TownBuildType.Town]: 2
                    },
                    3: {
                        [TownBuildType.Town]: 3
                    },
                    4: {
                        [TownBuildType.Town]: 4
                    },
                    5: {
                        [TownBuildType.Town]: 5
                    },
                    6: {
                        [TownBuildType.Town]: 6
                    },
                    7: {
                        [TownBuildType.Town]: 7
                    },
                    8: {
                        [TownBuildType.Town]: 8
                    },
                    9: {
                        [TownBuildType.Town]: 9
                    },
                    10: {
                        [TownBuildType.Town]: 10
                    }
                },
                items: [
                    { itemID: 'gold', amount: [3000, 3000, 10000] },
                    { itemID: 170001, amount: [200, 200, 200] },
                    { itemID: 170005, amount: [3, 3, 3], limitLvl: [3, 100] },
                ],
            }
        },
        {
            name: '铁匠',
            kind: TownBuildType.Make,
            unlockTownLvl: 2,
            unlockTownSaveScore: 80,
            maxLvl: 10,
            buildTime: [600000, 600000],
            npc: 'make',
            boomingValues: [0, 350, 0.5],
            effects: {
                [TownEffects.AddPerOfAttri]: {
                    attackPer: { limitLvl: 1, values: [0, 2] },
                    hit: { limitLvl: 3, values: [0, 2] },
                }
            },
            lvlUpNeed: {
                preLvl: {
                    2: {
                        [TownBuildType.Town]: 2
                    },
                    3: {
                        [TownBuildType.Town]: 3
                    },
                    4: {
                        [TownBuildType.Town]: 4
                    },
                    5: {
                        [TownBuildType.Town]: 5
                    },
                    6: {
                        [TownBuildType.Town]: 6
                    },
                    7: {
                        [TownBuildType.Town]: 7
                    },
                    8: {
                        [TownBuildType.Town]: 8
                    },
                    9: {
                        [TownBuildType.Town]: 9
                    },
                    10: {
                        [TownBuildType.Town]: 10
                    }
                },
                items: [
                    { itemID: 'gold', amount: [3000, 3000, 10000] },
                    { itemID: 170001, amount: [250, 250, 200] },
                    { itemID: 170005, amount: [5, 5, 3], limitLvl: [3, 100] },
                ],
            }
        },
        {
            name: '白虎',
            kind: TownBuildType.Monster,
            unlockTownLvl: 5,
            unlockTownSaveScore: 90,
            maxLvl: 10,
            buildTime: [600000, 600000],
            npc: 'make',
            boomingValues: [0, 350, 0.5],
            effects: {
                [TownEffects.AddPerOfAttri]: {
                    attackPer: { limitLvl: 1, values: [0, 2] },
                    hit: { limitLvl: 3, values: [0, 2] },
                }
            },
            lvlUpNeed: {
                preLvl: {
                    2: {
                        [TownBuildType.Town]: 2
                    },
                    3: {
                        [TownBuildType.Town]: 3
                    },
                    4: {
                        [TownBuildType.Town]: 4
                    },
                    5: {
                        [TownBuildType.Town]: 5
                    },
                    6: {
                        [TownBuildType.Town]: 6
                    },
                    7: {
                        [TownBuildType.Town]: 7
                    },
                    8: {
                        [TownBuildType.Town]: 8
                    },
                    9: {
                        [TownBuildType.Town]: 9
                    },
                    10: {
                        [TownBuildType.Town]: 10
                    }
                },
                items: [
                    { itemID: 'gold', amount: [3000, 3000, 10000] },
                    { itemID: 170001, amount: [250, 250, 200] },
                    { itemID: 170005, amount: [5, 5, 3], limitLvl: [3, 100] },
                ],
            }
        },
        {
            name: '黑商',
            kind: TownBuildType.Market,
            unlockTownLvl: 5,
            unlockTownSaveScore: 90,
            maxLvl: 10,
            buildTime: [600000, 600000],
            npc: 'make',
            boomingValues: [0, 350, 0.5],
            effects: {
                [TownEffects.AddPerOfAttri]: {
                    attackPer: { limitLvl: 1, values: [0, 2] },
                    hit: { limitLvl: 3, values: [0, 2] },
                }
            },
            lvlUpNeed: {
                preLvl: {
                    2: {
                        [TownBuildType.Town]: 2
                    },
                    3: {
                        [TownBuildType.Town]: 3
                    },
                    4: {
                        [TownBuildType.Town]: 4
                    },
                    5: {
                        [TownBuildType.Town]: 5
                    },
                    6: {
                        [TownBuildType.Town]: 6
                    },
                    7: {
                        [TownBuildType.Town]: 7
                    },
                    8: {
                        [TownBuildType.Town]: 8
                    },
                    9: {
                        [TownBuildType.Town]: 9
                    },
                    10: {
                        [TownBuildType.Town]: 10
                    }
                },
                items: [
                    { itemID: 'gold', amount: [3000, 3000, 10000] },
                    { itemID: 170001, amount: [250, 250, 200] },
                    { itemID: 170005, amount: [5, 5, 3], limitLvl: [3, 100] },
                ],
            }
        }
    ],
    task: [
        {
            kind: TownTask.KillMonster,
            name: '歼灭怪物',
            desc: '击杀城镇周边的作乱魔兽,可获得随机金币和提升随机点数安定值(最低5点安定值), 耗时values分钟',
            successDesc: '佣兵团成功击杀城镇周边的作乱魔兽,获得values1, 提升安定值values2点',
            failDesc: '魔兽发生异变实力大增,导致佣兵团死伤惨重, 失去values1, 降低安定值values2点',
            values2: [5, 10],
            failRate: 5,
            values: [1200000, -20000],
            reward: {
                resourceItems: [
                    { itemID: 'gold', amount: [100, 50] }
                ]
            }
        },
        {
            kind: TownTask.Escort,
            name: '护送商队',
            desc: '护送商人公会商队到圣都进行贸易,可获得随机魂晶和提升随机点数安定值(最低8点安定值),耗时values分钟',
            successDesc: '护送商人公会商队成功到达圣都,获得values1, 提升安定值values2点',
            failDesc: '敌对商会派出高级佣兵团袭击了商队,护送任务失败,失去values1, 降低安定值values2点',
            values2: [5, 10],
            failRate: 5,
            values: [1800000, -30000],
            reward: {
                resourceItems: [
                    { itemID: 'diamond', amount: [10, 0] }
                ]
            }
        },
        {
            kind: TownTask.Search,
            name: '鬼蜮探索',
            desc: '城镇的周边环绕着危险的区域, 探索完成可获得随机道具和提升随机安定值(最低10点安定值),耗时values分钟',
            successDesc: '成功探索城镇附近的一个区域,获得values1, 提升安定值values2点',
            failDesc: '黑暗中冲出一头精英魔兽,对探索的佣兵队伍造成重创, 降低安定值values2点',
            values2: [10, 5],
            failRate: 10,
            values: [3600000, -60000],
            reward: {
                random: true,
                items: [
                    { itemID: 170001, amount: [100, 100, 1] },
                    { itemID: 170002, amount: [100, 100, 1] },
                    { itemID: 170003, amount: [100, 100, 1] },
                    { itemID: 170004, amount: [5, 10, 1] },
                    { itemID: 170005, amount: [5, 5, 1] },
                    { itemID: 170015, amount: [10, 5, 1] },
                    { itemID: 170018, amount: [5, 5, 1] },
                    { itemID: 170026, amount: [5, 5] },
                ]
            }
        },
        {
            kind: TownTask.Defense,
            name: '抵御怪物',
            desc: '时空裂隙跑出了一群凶残的魔兽,正向着城镇跑来, 成功抵御可获得随机宝物和提升随机安定值(最低10点安定值)',
            successDesc: '成功抵御怪物攻城,获得values1, 提升安定值values2点',
            failDesc: '怪物冲击着城镇防御最薄弱的一侧,对城镇造成了巨大破坏, 降低安定值values2点',
            values2: [10, 5],
            values: [3600000, -60000],
            failRate: 15,
            dropItems: [173001, 173002, 173003, 173004, 173005, 173006, 173007, 173008, 173009, 173010, 173011, 173012, 173013, 173014, 173015, 173016],
            reward: {
                random: true,
                items: [
                    { itemID: 'treasure', amount: [1, 0] },
                ]
            }
        },
        {
            kind: TownTask.Jousting,
            name: '佣兵挑战',
            desc: '佣兵团的挑战任务, 完成挑战可获得随机经验值和提升随机安定值(最低10点安定值),耗时values分钟',
            successDesc: '没有一个能打的, 成功完成挑战获得values1, 提升安定值values2点',
            failDesc: '对手还是太强大,以微薄的差距输掉了挑战, 降低安定值values2点',
            values2: [10, 5],
            values: [3600000, -60000],
            failRate: 10,
            reward: {
                resourceItems: [
                    { itemID: 'exp', amount: [200, 200, 1] },
                ]
            }
        },
        {
            kind: TownTask.Contest,
            name: '城镇比武',
            desc: '城镇之间的比武大赛, 获得冠军可获得value1个佣兵徽章和提升随机安定值(最低10点安定值),耗时values分钟',
            successDesc: '无敌是最寂寞的, 获得冠军奖励values1, 提升安定值values2点',
            failDesc: '一山还有一山高,下次再努力冲击冠军吧, 降低安定值values2点',
            values2: [10, 5],
            values: [3600000, -6000],
            failRate: 10,
            reward: {
                random: true,
                items: [
                    { itemID: 170031, amount: [1, 0.5] },
                ]
            }
        },
    ],
    eventFreeTimes: 20,
    eventMaxTimes: 35,
    eventCountDown: 10000,
    eventItemUse: {
        items: [
            { itemID: 170007, amount: [1, 0] }
        ]
    },
    events: [
        {
            kind: TownEvent.TradeGold,
            name: '城镇交易',
            eventType: TownEventType.Award,
            desc: '游方商人路过小镇,采购了不少稀有材料和武器装备,获得金币xvalues',
            reward: {
                resourceItems: [
                    { itemID: 'gold', amount: [100, 10] }
                ]
            }
        },
        {
            kind: TownEvent.AttackLostGold,
            name: '怪物袭击',
            eventType: TownEventType.Punish,
            desc: '红月暴涨,城镇周边的魔物魔性大发,袭击了城镇,失去金币xvalues',
            reward: {
                resourceItems: [
                    { itemID: 'gold', amount: [10, 10] }
                ]
            }
        },
        {
            kind: TownEvent.AttackRewardExp,
            name: '抵御怪物',
            eventType: TownEventType.Award,
            desc: '天降异象,佣兵团抵御了从时空裂隙中出来的魔物,获得经验xvalues',
            reward: {
                resourceItems: [
                    { itemID: 'exp', amount: [10, 15] }
                ]
            }
        },
        {
            kind: TownEvent.TradeLostGold,
            name: '城镇交易',
            eventType: TownEventType.Award,
            desc: '黑心商人联合商人公会哄抬物价,被佣兵团捣毁阴谋,获得金币xvalues',
            reward: {
                resourceItems: [
                    { itemID: 'gold', amount: [50, 10] }
                ]
            }
        },
        {
            kind: TownEvent.TradeRareResource,
            name: '黑市交易',
            eventType: TownEventType.Award,
            desc: '哇,赚大了,从黑商手中捡漏购得稀有材料value1xvalues',
            reward: {
                random: true,
                items: [
                    { itemID: 170004, amount: [5, 10, 1] },
                    { itemID: 170005, amount: [5, 10, 1] },
                    { itemID: 170015, amount: [10, 10, 1] },
                    { itemID: 170018, amount: [5, 5, 1] },
                    { itemID: 170026, amount: [5, 5] },
                ]
            }
        },
        // {
        //     kind: TownEvent.AttackLvlDownTown,
        //     name: '怪物攻城',
        //     eventType: TownEventType.Punish,
        //     desc: '',
        //     townLvl: -1,
        //     triggerRate: 1
        // },
        {
            kind: TownEvent.ChestRewardTreasure,
            name: '地城探宝',
            eventType: TownEventType.Award,
            desc: '经历了重重挑战, 佣兵团在幽深的地城之中找到了一个宝箱,获得value1xvalues',
            triggerRate: 1,
            reward: {
                dropItems: [173001, 173002, 173003, 173004, 173005, 173006, 173007, 173008, 173009, 173010, 173011, 173012, 173013, 173014, 173015, 173016],
                items: [
                    { itemID: 'treasure', amount: [1, 0] },
                ]
            }
        },
        {
            kind: TownEvent.ChestLostGold,
            name: '地城探宝',
            eventType: TownEventType.Punish,
            desc: '经历了重重挑战, 佣兵团在幽深的地城之中找到了一个宝箱,不料宝箱竟然暗藏机关,导致损失惨重,损失金币values',
            reward: {
                resourceItems: [
                    { itemID: 'gold', amount: [10, 10] }
                ]
            }
        },
        {
            kind: TownEvent.ChestGetLucky,
            name: '地城探宝',
            eventType: TownEventType.Award,
            desc: '经历了重重挑战, 佣兵团在幽深的地城之中找到了一个宝箱,喜获value1xvalues',
            reward: {
                items: [
                    { itemID: 170009, amount: [1, 0.2] }
                ]
            }
        },
        {
            kind: TownEvent.CheatRewardBadge,
            name: '地城探宝',
            eventType: TownEventType.Award,
            desc: '经历了重重挑战,佣兵团在幽深的地城之中找到了一个宝箱,获得value1xvalues',
            triggerRate: 1,
            reward: {
                items: [
                    { itemID: 170031, amount: [1, 0.2] },
                ]
            }
        },
        {
            kind: TownEvent.StormAttack,
            name: '风暴灾害',
            eventType: TownEventType.Punish,
            desc: '巨型龙卷风袭击城镇,破坏了近半数的建筑,损失金币xvalues',
            reward: {
                resourceItems: [
                    { itemID: 'gold', amount: [10, 8] }
                ]
            }
        },
        {
            kind: TownEvent.AttackThife,
            name: '剿灭山贼',
            eventType: TownEventType.Award,
            desc: '剿灭城镇周边的山贼巢穴,发现大批财宝,获得金币xvalues',
            reward: {
                resourceItems: [
                    { itemID: 'gold', amount: [15, 10] }
                ]
            }
        },
        {
            kind: TownEvent.Patrol,
            name: '城镇巡逻',
            eventType: TownEventType.Award,
            desc: '在城镇的黑暗角落,一群黑商正在鬼鬼祟祟的往外倒腾点什么东西,被巡逻的佣兵逮了个正着,获得魂晶xvalues',
            reward: {
                items: [
                    { itemID: 'diamond', amount: [50, 20] }
                ]
            }
        },
        {
            kind: TownEvent.Hunting,
            name: '野外狩猎',
            eventType: TownEventType.Award,
            desc: '城镇举行大型的狩猎比赛,你获得了第一名,获得魂晶xvalues',
            reward: {
                items: [
                    { itemID: 'diamond', amount: [20, 10] }
                ]
            }
        },
        {
            kind: TownEvent.Build,
            name: '城镇建设',
            eventType: TownEventType.Award,
            desc: '城镇在你的英明统治下,一派欣欣向荣的景象,国王得知后十分高兴,赠予你value1xvalues',
            triggerRate: 1,
            reward: {
                items: [
                    { itemID: 170008, amount: [1, 0] }
                ]
            }
        },
        {
            kind: TownEvent.Deep,
            name: '深渊扫荡',
            eventType: TownEventType.Award,
            desc: '在幽暗的深渊,你正在打扫战场,突然一个不起眼的角落爆发出一团幽光,你走近一看,竟然是value1xvalues',
            triggerRate: 1,
            reward: {
                items: [
                    { itemID: 170007, amount: [1, 0] }
                ]
            }
        },
        {
            kind: TownEvent.Deep,
            name: '深渊扫荡',
            eventType: TownEventType.Award,
            desc: '在幽暗的深渊,你正在打扫战场,突然一个不起眼的角落爆发出一团幽光,你走近一看,竟然是value1xvalues',
            triggerRate: 1,
            reward: {
                items: [
                    { itemID: 170007, amount: [1, 0] }
                ]
            }
        },
        {
            kind: TownEvent.Business1,
            name: '微服私访',
            eventType: TownEventType.Award,
            desc: '身为团长,竟然还跑去摆摊体验生活,辛苦卖了一天货,获得value1xvalues',
            reward: {
                random: true,
                items: [
                    { itemID: 170004, amount: [5, 5, 1] },
                    { itemID: 170005, amount: [5, 3, 1] },
                    { itemID: 170015, amount: [10, 5, 1] },
                    { itemID: 170018, amount: [5, 5, 1] },
                    { itemID: 170026, amount: [5, 5] },
                ]
            }
        },
        {
            kind: TownEvent.Business2,
            name: '军团联盟',
            eventType: TownEventType.Award,
            desc: '你和临近佣兵团缔结联盟,互通有无,获得value1xvalues',
            reward: {
                random: true,
                items: [
                    { itemID: 170004, amount: [5, 5, 1] },
                    { itemID: 170005, amount: [5, 2, 1] },
                    { itemID: 170015, amount: [5, 3, 1] },
                    { itemID: 170018, amount: [1, 5, 1] },
                    { itemID: 170026, amount: [2, 4] },
                ]
            }
        },
        {
            kind: TownEvent.Business3,
            name: '加官晋爵',
            eventType: TownEventType.Award,
            desc: '在你的英明统治下,城镇发展迅猛,获得上级嘉奖value1xvalues',
            reward: {
                random: true,
                items: [
                    { itemID: 170004, amount: [5, 2, 1] },
                    { itemID: 170005, amount: [1, 5, 1] },
                    { itemID: 170015, amount: [2, 5, 1] },
                    { itemID: 170018, amount: [2, 3, 1] },
                    { itemID: 170026, amount: [2, 3] },
                ]
            }
        },
    ],
    // 泉水
    springReward: {
        baseDiamond: 100,
        baseValues: [0, 20],
        boomingBaseDiamond: 100,
        boomingThreshold: {
            50000: 100,
            100000: 200,
            150000: 300,
            250000: 400,
            500000: 500,
            750000: 600,
            1000000: 700,
            2000000: 800,
            4000000: 900,
        },
        saveScoreThreshold: {
            0: 50,
            20: 55,
            50: 60,
            60: 65,
            70: 70,
            80: 75,
            90: 80,
            95: 90,
            100: 100,
            110: 100,
            120: 100,
        }
    },
    // 铁匠
    makeConfig: {
        unLockBaseMakeLvl: 1,
        unLockMakeLvl: 5,
        unLockTreasureLvl: 3,
        unLockWashTreasure: 10,
        baseMakeQuality: {
            1: [40, -2],
            2: [30, -1],
            3: [10, 1],
            4: [5, 1],
            5: [3, 0.8],
            6: [2, 0.2]
        },
        highMakeQuality: {
            1: [0, 0],
            2: [0, 0],
            3: [0, 0],
            4: [65, -1.5],
            5: [25, 1],
            6: [10, 0.5]
        },
        baseMakeNeed: {
            items: [
                { itemID: 170001, amount: [500, 500] },
                { itemID: 170003, amount: [500, 500] },
                { itemID: 170004, amount: [2, 2], limitLvl: [5, 100] },
                { itemID: 170005, amount: [1, 1], limitLvl: [8, 100] },
            ]
        },
        highMakeNeed: {
            items: [
                { itemID: 170004, amount: [2, 2]},
                { itemID: 170005, amount: [1, 1]},
                { itemID: 170009, amount: [2, 0]},
            ]
        },
        treatureEatUpNeed: {
            items: [
                { itemID: 'diamond', amount: [100, 10] }
            ]
        }
    },
    townMarketDayItemNum: 5,  // 每日黑商道具数量
    townMarketItems: [
        {itemID1: 170008, amount1: 1, itemID2: 'diamond2', amount2: 50, limit: 5},
        {itemID1: 'diamond2', amount1: 10, itemID2: 170001, amount2: 100000, limit: 10},
        {itemID1: 170005, amount1: 5, itemID2: 170001, amount2: 50000, limit: 5},
        {itemID1: 170009, amount1: 1, itemID2: 170007, amount2: 5, limit: 10},
        {itemID1: 170023, amount1: 5, itemID2: 170002, amount2: 100000, limit: 5},
        {itemID1: 170015, amount1: 10, itemID2: 170010, amount2: 1000, limit: 5},
        {itemID1: 170004, amount1: 10, itemID2: 170003, amount2: 100000, limit: 5},
        {itemID1: 170009, amount1: 1, itemID2: 'diamond', amount2: 100, limit: 5},
        {itemID1: 170031, amount1: 5, itemID2: 'diamond', amount2: 100, limit: 5},
        {itemID1: 170018, amount1: 10, itemID2: 170004, amount2: 10, limit: 5},
        {itemID1: 170026, amount1: 10, itemID2: 'diamond', amount2: 500, limit: 5},
        {itemID1: 170015, amount1: 5, itemID2: 170012, amount2: 10, limit: 5},
    ]
}